﻿using System;
using System.Collections.Generic;

namespace Inovout
{
    public static class TypeDefaultValue
    {
        private static readonly IDictionary<Type, object> defaultValues;
        static TypeDefaultValue()
        {
            defaultValues = new Dictionary<Type, object>(); defaultValues.Add(typeof(Guid), default(Guid));
            defaultValues.Add(typeof(int), default(int));
        }

        public static object GetValue(Type type)
        {
            object value = null;
            if (!defaultValues.TryGetValue(type, out value))
            {
                throw new NotSupportedException(string.Format("{0} can not be supported.", type.Name));
            }
            return value;
        }
    }
}
